/*
* @Author: mmall
* @Date:   2017-05-27 17:57:49
* @Last Modified by:   Administrator
* @Last Modified time: 2017-11-27 13:40:09
*/

$(function(){

    $("footer").load("layout/footer.html");
    $("header").load("layout/header2.html");


    var listHtml=$("#wbclist").html(); 
    var storeHtml=$("#storedetail").html(); 

$(document).on("click",".sort-item",function(){
  $(this).addClass("changered").siblings().removeClass("changered");
})
// 列表

$.ajax({
        url: "data/wobiancao.json",
        type: "get",
        success: function(data) {
           var listdata=data.list;
           $('.p-list-con').html(doT.template(listHtml)(listdata));
        }
})

 $.ajax({
        url: "data/wbcdetail.json",
        type: "get",
        success: function(data) {
           var storedata=data.store;
           $('.storedetail').html(doT.template(storeHtml)(storedata));
        },
        error:function(){
          console.log("error")
        }
  })

setTimeout(function(){

$(document).ready(function(){
    var showproduct = {
      "boxid":"showbox",
      "sumid":"showsum",
      "boxw":220,
      "boxh":220,
      "sumw":45,
      "sumh":45,
      "sumi":7,//列表间隔
      "sums":4,//列表显示个数
      "sumsel":"sel",
      "sumborder":1,//列表边框，没有边框填写0，边框在css中修改
      "lastid":"showlast",
      "nextid":"shownext"
      };//参数定义    
   $.ljsGlasses.pcGlasses(showproduct);//方法调用，务必在加载完后执行
})
    var location=$(".list-lis-location i").html()
    var map = new BMap.Map("allmap");          
    map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
    var local = new BMap.LocalSearch(map, {
      renderOptions:{map: map}
    });
  
    local.search(""+location+""); 
$(document).on("click",".detailright",function(){
    
    $(this).addClass("map")
})


},1)
})
  